package com.caohx.bms.service;

import com.caohx.bms.pojo.User;
import com.caohx.bms.pojo.dto.LoginDto;
import com.caohx.bms.pojo.dto.UserDto;
import com.caohx.bms.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

public interface IUserService {


    /**
     * 添加用户
     * @param user  要添加的用户信息，来自前端页面
     */
    User add(UserDto user);

    User get(Integer userid);

    /**
     * 修改用户
     * @param user  要添加的用户信息，来自前端页面
     */
    User edit(UserDto user);

    void delete(Integer userid);

    boolean existsByUserName(String userName);

    boolean existsByUserEmail(String userEmail);

    boolean login(LoginDto loginDto);



    Page<User> listUsers(Pageable pageable);
}
